﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TechnicRequests>" %>
<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TechnicRequests>" %>--%>
<%@ Import Namespace="CRM.Resourses" %>
<%@ Import Namespace="CRM.Models" %>

<%
    var equpmentsCol = new CRM.Database.Model.EquipmentsCollection();
%>

<% Html.DevExpress().GridView(settings =>
                    {
                        settings.Name = "gdTechnicRequestsEquipments";
                        settings.KeyFieldName = "IdTechnicRequestsEquipment";
                        settings.CallbackRouteValues = new { Controller = "TD", Action = "TechnicRequestsEquipmentsPartial", idRequest = Model.IdTechnicRequest };
                        settings.SettingsPager.PageSize = 20;
                        settings.Width = 496;
                        settings.Columns.Add(column =>
                        {
                            column.Caption = Resourses.EquipmentModel;
                            column.FieldName = "ModelExt";
                        });

                        settings.Columns.Add(column =>
                        {
                            column.Caption = Resourses.EquipmentType;
                            column.FieldName = "EquipmentTypeNameLocalized";
                        });

                        settings.Columns.Add(column =>
                        {
                            column.Caption = Resourses.EquipmentVendor;
                            column.FieldName = "VendorNameExt";
                        });

                        settings.Columns.Add(column =>
                        {
                            column.Caption = Resourses.EquipmentCount;
                            column.FieldName = "EquipmentCount";
                        });

                        settings.Columns.Add(column =>
                        {
                            column.Caption = Resourses.EquipmentProductionDate;
                            column.FieldName = "IssueDate";
                        });


                    }).Bind(equpmentsCol.GetBindingsEquipmentsListByRequestId(Model.IdTechnicRequest)).GetHtml();
                    //}).Bind(DB.GetBindingsEquipmentsListByRequestId(Model.IdTechnicRequest)).GetHtml();
%>